package team.archai.nexus.boot.auth.token;

import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import org.apache.shiro.authc.AuthenticationToken;
import team.archai.nexus.boot.auth.model.AuthenticatedInfo;

/**
 * @description: shiro jwtToken
 * @author: lishibin
 * @create: 2020-06-26 23:10
 **/
@Getter
@Setter
@Builder
public class ShiroJwtAuth implements IAuth,AuthenticationToken {

    // 密钥
    private Object token;

    private AuthenticatedInfo authenticatedInfo;

    public ShiroJwtAuth(Object token, AuthenticatedInfo authenticatedInfo) {
        this.token = token;
        this.authenticatedInfo = authenticatedInfo;
    }

    @Override
    public AuthenticatedInfo getPrincipal() {
        return authenticatedInfo;
    }

    @Override
    public Object getCredentials() {
        return token;
    }
}
